/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-02-13
 * Time: 16:55
 */
public class test1 {
    /**
     * LeetCode 递归乘法
     */

    public int multiply(int A, int B) {
        int min = Math.min(A,B);
        int max = Math.max(A,B);
        int ret = 0;

        for(int i=0;min!=0;i++){
            if((min & 1)==1){
                ret += max<<i;
            }
            min >>=1;
        }
        return ret;
    }
}
